package com.study.design.pattern.pattern.behavioral.command;

/**
 * @Author: gongsl
 * @Date: 2025-03-24 23:19
 * @description: 具体命令：打开电视
 */
public class TurnOnCommand implements Command {
    private TV tv;

    public TurnOnCommand(TV tv) {
        this.tv = tv;
    }

    @Override
    public void execute() {
        tv.turnOn();
    }

    @Override
    public void undo() {
        tv.turnOff();
    }
}
